package book;

/**
 * Version: 1.1
 * Author: TangJun
 * Date: 2024-07-18
 */
public class Book {
    private String name;//书名
    private String author;//作者
    private float price;//价格
    private boolean isBorrowed;//是否借出

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public boolean isBorrowed() {
        return isBorrowed;
    }

    public void setBorrowed(boolean borrowed) {
        isBorrowed = borrowed;
    }

    public Book(String name, String author, float price) {
        this.name = name;
        this.author = author;
        this.price = price;
    }

    @Override
    public String toString() {
        return "书名：《" + this.name + "》  "
                + "作者：" + this.author + "  "
                + "价格：" + this.price + "  "
                + "是否借出：" + (this.isBorrowed ? "已借出" : "未借出");
    }
}
